<?php
class Zendvn_View_Helper_CmsButton extends Zend_View_Helper_Abstract{
	
	//$option =array('type'=>'submit','name'=>'appForm');
	
	public function cmsButton($name = 'Button',$values = '#',$attribs = null,$options = null){
		$iconDir = $attribs['iconDir'];
		if(empty($iconDir)) $iconDir = 'images/toolbar/';		
		
		$icon = $attribs['icon'];
		if(empty($icon)) $icon = 'icon-32-default.png';
		
		$src = $iconDir . $icon;
		
		$link = $values;
		
		if($options['type'] == 'submit'){
			$link = "javascript:onSubmitForm('" . $options['name'] . "','" .  $values . "')";
		}	
			
		$xhtml = '<div class="toolbar-button" >
					<a href="'. $link . '">
        				<img src="'. $src . '">  
                    	<br>' . $name . '
                    </a>
                  </div>';
		return $xhtml;
		
	}
}